<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>
    	<spring:message code="head.clothGarment"></spring:message>-
	    <spring:message code="head.homePage"></spring:message>
    </title>
    <!--公共样式-->
    <link href="${pageContext.request.contextPath }/web/css/font/iconfont.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/NormalizeFile.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/public.css" />
    <!--首页私有样式-->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/subpage/index.css" />
    <!-- -轮播样式- -->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/index/base.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/index/common.css" />
    <style type="text/css">

	#slider{
		position:relative;
		width:100%;
		height:468px;
	}
	#slider img{
		position:absolute;
		left:0px;
		top:0px;
		width:100%;
		height:100%;
	}
</style>
</head>
<body class="min-w-1260">
<jsp:include page="head.jsp"></jsp:include>
<!--banner begin-->
<div class="banner_lun">
	
	<div class="slider" id="slider" e-fun="slider">
	 <c:forEach items="${shufflingFigure }" var="shuff" varStatus="t">	  
	    <a href="${pageContext.request.contextPath }/web/information/informationDetails?id=${shuff.sfMessage1}" ><img src="${pageContext.request.contextPath }/upload/${shuff.sfUrl}" alt="" /></a> 	   		          
    </c:forEach>	
	</div>
</div>
<%-- <div style="margin-top:114px;height: 520px;background:url('${pageContext.request.contextPath }/upload/${shufflingFigure.sfUrl }') no-repeat center center;    background-size: 100% auto;"></div> --%>
<!--banner end-->
<!--花型主题 begin-->
<c:if test="${not empty themeList }">
<div class="flower-type-theme">
    <div class="contenter flower-red-back-pos">
        <div class="flower-red-back"></div>
        <ul class="flower-type-theme-cont">
             <li class="flower-type-red"><spring:message code="pattern.pattern"></spring:message><br/><spring:message code="pattern.theme"></spring:message>
            </li>
            <c:forEach items="${themeList }" var="theme" varStatus="t">
	            <c:if test="${t.index<6 }">
		            <li class="ih-item square effect">
		                <a href="${pageContext.request.contextPath }/web/theme/details?id=${theme.id}">
		                    <div class="img"><img src="${pageContext.request.contextPath }/upload/${theme.img }" alt="img"></div>
		                    <div class="info">
		                        <h3>${theme.name }</h3>
		                    </div>
		                </a>
		            </li>
	            </c:if>
            </c:forEach>
            <li class="flower-type-more">
               <a href="${pageContext.request.contextPath }/web/theme/main" onfocus="blur();">
                	<h3><spring:message code="more"></spring:message></h3>
                </a>  
            </li>
        </ul>
    </div>
</div>
</c:if>
<!--花型主题 end-->
<!--秀场同步 begin-->
<div class="index-show">
    <div class="contenter">
        <div class="index-show-left">
            <img src="${pageContext.request.contextPath }/web/img/showbg.jpg">
            <span>
            	<h4><spring:message code="index.show"></spring:message></h4>
            	<p><spring:message code="index.trend"></spring:message><br/><spring:message code="index.dev"></spring:message></p>
            </span>
        </div>
        <div class="index-show-right">
        <div class="container" style="overflow:hidden;">
                <ul class="change_prod cont">
            	<c:set var="c" value="0"></c:set>
                <c:forEach items="${showList }" var="s" varStatus="show">
		            <c:if test="${s.parentId==0 }">
		            	<li <c:if test="${c==0 }">class="on"</c:if>>${s.name }</li>
		            	<c:set var="c" value="${c+1 }"></c:set>
		            </c:if>
	            </c:forEach>
            </ul>
            <div class="wrap-scroll-bar">
                    <div class="scroll-bar"></div>
                </div>
                </div>
            <c:set var="c1" value="0"></c:set>
             <c:forEach items="${showList }" var="s1">
            	<c:if test="${s1.parentId==0 }">
            		<div class="change_prod_cont <c:if test="${c1==0 }">on</c:if>">
            			<ul class="index-show-right-list" id="show${c1 }" style="clear:both;">
	            			<c:forEach items="${showList }" var="s2">
	            				<c:if test="${s2.parentId == s1.id }">
	            					<li><a href="${pageContext.request.contextPath }/web/show/showFieldList" onfocus="blur();">${s2.name }</a></li>
	            				</c:if>
	            			</c:forEach>
            			</ul>
            			<!--显示字母序的层。注：此层id必需是ul的id+"-nav"-->
           				<div class="index-show-right-index" id="show${c1 }-nav"></div>
            		</div>
            		<c:set var="c1" value="${c1+1 }"></c:set>
            	</c:if>
            </c:forEach>
            <input type="hidden" id="c1" value="${c1 }">
        </div>
        <div class="clearfix"></div>
    </div>
</div>
<!--秀场同步 end-->
<!--版布开发 begin-->
<c:if test="${not empty bbList }">
<div class="index-exploit">
    <div class="contenter">
        <div class="content-title">
	        <span>
	   			<spring:message code="index.fabricDev"></spring:message>     
	        </span>
        </div>
        <ul class="index-exploit-list">
        	<c:forEach items="${bbList }" var="bb">
            	<li>
            		<div class="list-bor long_img">
            			<a href="${pageContext.request.contextPath }/web/fabric/detail?fId=${bb.fId}" onfocus="blur();">
            				<img src="${pageContext.request.contextPath }/upload/${bb.image }" />
            			</a>
            			<div class="index-exploit-like" onclick="attention(1,${bb.fId});">
	            			<c:if test="${not empty member }">
								<c:if test="${member.mId==bb.mId }">
									<img id="attImg1${bb.fId}" src="${pageContext.request.contextPath }/web/img/icon_alreadycollected.png" />
								</c:if>
								<c:if test="${member.mId!=bb.mId }">
									<img id="attImg1${bb.fId}" src="${pageContext.request.contextPath }/web/img/icon_addcollection.png" />
								</c:if>
							</c:if>	
							<c:if test="${empty member }">
								<img id="attImg1${bb.fId}" src="${pageContext.request.contextPath }/web/img/icon_addcollection.png" />
							</c:if>
           				</div>
       				</div>
   				</li>
            </c:forEach>
            <li><a href="${pageContext.request.contextPath }/web/fabric/cloth/all" onfocus="blur();"><div class="list-bor"><spring:message code="toViewMore"></spring:message></div></a></li>
        </ul>
    </div>
</div>
</c:if>
<!--版布开发 end-->
<!--开发样本 begin-->
<c:if test="${not empty ybList }">
<div class="development-samples">
	<div class="deve-title">
		<h3><spring:message code="developmentSamples"></spring:message></h3>
		<div class="deve-more">
			<a href="${pageContext.request.contextPath }/web/fabric/sample/all" onfocus="blur()">
			<spring:message code="more"></spring:message></a>
		</div>
	</div>
	<ul class="deve-cont">
		<c:forEach items="${ybList }" var="yb" varStatus="y" >
			<c:if test="${y.index<4 }">
			<li>
				<a href="${pageContext.request.contextPath }/web/fabric/detail?fId=${yb.fId}" onfocus="blur();">
					<div class="deve-list-img">
						<img src="${pageContext.request.contextPath }/upload/${yb.image }" />
					</div>
				</a>
				<a href="javascript:void(0)" onfocus="blur();">
					<p>${yb.fName }</p>
				</a>
				<div class="deve-cont-like" onclick="attention(1,${yb.fId});">
					<c:if test="${not empty member }">
						<c:if test="${member.mId==yb.mId }">
							<img id="attImg1${yb.fId}" src="${pageContext.request.contextPath }/web/img/icon_alreadycollected.png" />
						</c:if>
						<c:if test="${member.mId!=yb.mId }">
							<img id="attImg1${yb.fId}" src="${pageContext.request.contextPath }/web/img/icon_addcollection.png" />
						</c:if>
					</c:if>	
					<c:if test="${empty member }">
						<img id="attImg1${yb.fId}" src="${pageContext.request.contextPath }/web/img/icon_addcollection.png" />
					</c:if>
				</div>
			</li>
			</c:if>
		</c:forEach>
	</ul>
</div>
</c:if>
<!--开发样本end-->
<!--最新花型begin-->
<c:if test="${not empty pList }">
<div class="index-exploit">
    <div class="contenter">
        <div class="content-title">
        	<span><spring:message code="index.pattern"></spring:message></span>
       	</div>
        <ul class="index-exploit-list">
        	<c:forEach items="${pList }" var="p">
            	<li>
            		<div class="list-bor">
            		<a href="javascript:xiangqing('${p.isVip}','${p.pId}')" onfocus="blur();">
            			<div class="list-bor">
            				<img src="${imgpath }${p.pImg }" />
           				</div>
        				<c:if test="${p.isVip==2 }">
        					<div class="serial-vip">VIP</div>
        				</c:if>
	       				<div class="clearfix"></div>
       				</a>
       				<div class="deve-cont-like" onclick="attention(2,${p.pId});">
						<c:if test="${not empty member }">
							<c:if test="${member.mId==p.mId }">
								<img id="attImg2${p.pId}" src="${pageContext.request.contextPath }/web/img/icon_alreadycollected.png" />
							</c:if>
							<c:if test="${member.mId!=p.mId }">
								<img id="attImg2${p.pId}" src="${pageContext.request.contextPath }/web/img/icon_addcollection.png" />
							</c:if>
						</c:if>	
						<c:if test="${empty member }">
							<img id="attImg2${p.pId}" src="${pageContext.request.contextPath }/web/img/icon_addcollection.png" />
						</c:if>
					</div>
					</div>
   				</li>
            </c:forEach>
            <li><a href="${pageContext.request.contextPath }/web/patternfilter/all/flowertypecatalog1" onfocus="blur();"><div class="list-bor"><spring:message code="toViewMore"></spring:message></div></a></li>
        </ul>
    </div>
</div>
</c:if>
<!--最新花型end-->
<!--vip begin-->
<div class="index-vip">
    <img src="${pageContext.request.contextPath }/web/img/index-vip.jpg" />
    <p><spring:message code="index.vip.line1"></spring:message></p>
    <p><spring:message code="index.vip.line2"></spring:message></p>
    <button type="button" onclick="toVipInfoPage()"><spring:message code="vipExplain"></spring:message></button>
    <button type="button" onclick="toVipPage()"><spring:message code="applyForVip"></spring:message></button>
</div>
<!--vip end-->
<jsp:include page="bottom.jsp"></jsp:include>
<!--全局-->
<!--ie789下placeholder不兼容-->
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/placeholder.js"></script>
<!--获取中文首字母的函数，需要jQuery支持-->
<script src="${pageContext.request.contextPath }/web/js/jquery.charfirst.pinyin.js" type="text/javascript"></script>
<!--ListNav是一个用于创建按字母顺序分类导航的jQuery插件。-->
<script src="${pageContext.request.contextPath }/web/js/jquery.listnav.min-2.1.js" type="text/javascript"></script>
<!--虚拟滚动条jquery插件-->
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/jquery.slimscroll.js"></script>
<!--横向虚拟滚动条-->
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/wheel.js"></script>
<!--index页面私有js-->
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/subpage/index.js"></script>

<!-- 轮播js -->
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/banner/common.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/banner/simba.website.js"></script>

<script type="text/javascript">

	//跳转到vip页面
	function toVipPage(){
		var flag=validateVip();
		if(flag==0){     //如果是vip用户，则弹窗提示用户已经是vip用户，不能再次申请。
			layer.msg('<spring:message code="index.VipUser"></spring:message>',{icon:0,time:1000});
		}else if(flag==2){    //如果不是vip用户，跳转到vip用户申请界面
			window.location.href='${pageContext.request.contextPath }/web/vip/applicationForVIP';
		}else if(flag==1){    //用户未登录，直接跳转至登录页
			layer.confirm('<spring:message code="flowertypecatalog.notLogin"></spring:message>', {
        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
        	title:'<spring:message code="flowertypecatalog.message"></spring:message>'
        	}, function(index){
        		location.href="${pageContext.request.contextPath}/web/member/login";
        	},function(index){
        		
        	});
		}
	}
	//校验用户是否为vip用户
	function validateVip(){
		var status=1;
		$.ajax({
			async:false,
			url:'${pageContext.request.contextPath }/web/vip/validateVip',
			type:'post',
			success:function(result){
				status=result.msg.status;
			}
		});
		return status;
	}
	
	//跳转到vip说明页面
	function toVipInfoPage(){
		window.location.href='${pageContext.request.contextPath }/web/help/vipInfo-5/index';
	}
	//关注
    function attention(type,aId){
    	$.ajax( {  
    		type : "POST",  
             url : "${pageContext.request.contextPath }/member/member/attention",
             data : {type:type,aId:aId},
             success: function(data) {
            	 if(data == 1){//取消关注成功
            	 	layer.msg('<spring:message code="caozuochenggong"></spring:message>',{icon:1,time:1000});
            		 $("#attImg"+type+aId).attr('src','${pageContext.request.contextPath }/web/img/icon_addcollection.png');  
            	 }else if(data == 2){//关注成功
            		 layer.msg('<spring:message code="caozuochenggong"></spring:message>',{icon:1,time:1000});
            		 $("#attImg"+type+aId).attr('src','${pageContext.request.contextPath }/web/img/icon_alreadycollected.png');
            	 }else{
            		 layer.msg('<spring:message code="caozuoshibai"></spring:message>',{icon:0,time:1000});
            	 }
             }
    	});
    }
    function xiangqing(vip,patternId){
		if(vip==2){
		$.ajax({url:'${pageContext.request.contextPath }/web/patternfilter/judge', async : false,type : "POST",  success :function(result){
			 var status=result.msg.status;
			 var desc=result.msg.desc;
			    if(status == 1){//没登录
			    	layer.confirm('<spring:message code="flowertypecatalog.notLogin"></spring:message>', {
		        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
		        	  title:'<spring:message code="flowertypecatalog.message"></spring:message>'
		        	}, function(index){
		        		location.href="${pageContext.request.contextPath}/web/member/login";
		        	},function(index){
		        		
		        	});
			    	flag=true;
			    }else if(status ==2){
			    	layer.confirm('<spring:message code="flowertypecatalog.applyForVIP"></spring:message>', {
			        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
			        	  title:'<spring:message code="flowertypecatalog.message"></spring:message>'
			        	}, function(index){
			        		location.href="${pageContext.request.contextPath}/web/vip/applicationForVIP";
			        		layer.close(index);
			        	},function(index){
			        		layer.close(index);
			        	});
			    	
			    }else{
			    	top.location.href='${pageContext.request.contextPath}/web/pattern/flowerCatalog?id='+patternId;
			    }
		  	}
		});
		}else{
			$.ajax({url:'${pageContext.request.contextPath }/web/patternfilter/judge', async : false,type : "POST",  success :function(result){
	   			 var status=result.msg.status;
	   			 var desc=result.msg.desc;
	   			    if(status == 1){//没登录
	   			    	layer.confirm('<spring:message code="flowertypecatalog.notLogin"></spring:message>', {
	   			        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
	   			        	title:'<spring:message code="flowertypecatalog.message"></spring:message>'
	   			        	}, function(index){
	   			        		location.href="${pageContext.request.contextPath}/web/member/login";
	   			        	},function(index){
	   			        		
	   			        	});
	   			    	
	   			    }else{
	   			    	top.location.href='${pageContext.request.contextPath}/web/pattern/flowerCatalog?id='+patternId;
	   			    }
		}
	});
		}
	}
</script>

<script type="text/javascript">
	//判断浏览器内核
		var browser={
			versions:function(){
			var u = navigator.userAgent, app = navigator.appVersion;            
			return {
				trident: u.indexOf('Trident') > -1, //IE内核
				presto: u.indexOf('Presto') > -1, //opera内核
				webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
				gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
				mobile: !!u.match(/AppleWebKit.*Mobile.*/)||!!u.match(/AppleWebKit/), //是否为移动终端
				ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
				android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
				iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
				iPad: u.indexOf('iPad') > -1, //是否iPad
				webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
			};
			}()
		}
		if(browser.versions.ios||browser.versions.android||browser.versions.iPhone||browser.versions.iPad){
			window.location.href="${pageContext.request.contextPath}/api/main/index";
		}
	</script>
</body>
</html>